1. Field of Invention
The present invention relates to a method of dynamic contrast enhancement, and more particularly, to a method for conducting dynamic contrast enhancement by using a threshold value.
2. Description of the Related Art
The so-called dynamic contrast enhancement (DCE) is an image processing technique, by which the grayscales of an input image are re-assigned mainly for increasing the dynamic range of the important portion of the image and enhancing the visual contrast of image characteristics. Taking an 8-bit image with 256 grayscales as an example, the grayscales thereof can possess a uniform distribution across the 0-255 range. However, as a matter of fact, the grayscale distribution of an image in a film is varied.
In terms of image processing, the statistical histogram-balancing technique is a classic and effective means to enhance images. Once a frame data is received, the image characteristics of the frame would be transformed into one with a more uniform grayscale distribution in the prior art. It is well known that a histogram of an image is an approximate probability density function (approximate pdf) of the grayscale levels of all the pixels corresponding to the image. A histogram-balancing processing is able to make the image after received the processing have a uniform or an approximate uniform distribution of the pixel numbers across all the grayscale levels. Limited by a real circuit, however, it is not feasible to produce a distribution considering every individual grayscale.
Therefore, the conventional processing is to perform a statistical algorithm on a received frame based on a certain number of discrete statistical intervals. FIG. 1A is a grayscale distribution graph of a frame and FIG. 1B is the transformation curve graph of the frame in FIG. 1A after performing dynamic contrast enhancement processing based on the prior art. Referring to FIGS. 1 and 2, in the prior art, the entire nominal grayscale range of a frame is equally divided into a certain number of intervals. For example, in FIG. 1A, there are four intervals in total, which are n1(0-63), n2(64-127), n3(128-191) and n4(192-255). After that, the number of pixels of each the interval is counted, so as to produce a statistical histogram shown by FIG. 1B.
Assuming the number of pixels of each the interval, i.e. the statistical values, is 575, 374, 393 and 97 corresponding to n1, n2, n3 and n4, respectively; hence, an average number of pixels of every internal should be 360. In the prior art, the statistical value of every interval is divided by 360 in this case to obtain a value defined as a slope value for every interval. For example, the statistical value ‘575’ of the interval n1 is divided by 360 and a slope value of 1.6 is obtained. After all the slope values corresponding to all the intervals are calculated, a transformation curve 101 as shown in FIG. 1B can be constructed. Thus, the pixel number of each interval can be further adjusted according to the transformation curve, so as to perform a DCE processing on the frame.
Note that not all images have a grayscale distribution like the curve shown in FIG. 1A. FIG. 2A is a grayscale distribution graph of another frame. Referring to FIG. 2A, in some frames, most of the pixels are likely to be concentrated in a narrow range of grayscale, and the corresponding transformation curve is accordingly as shown in FIG. 2B.
Referring to FIG. 2B, since most of the pixel numbers fall in the first interval of the grayscale distribution graph, the transformation curve 201 in FIG. 2B drastically climbs up at the beginning, while, in contrast, the slopes of the transformation curve 201 across the rest intervals are nearly zero.
FIG. 2C is the updated grayscale distribution graph of the frame in FIG. 2A by using the transformation curve in FIG. 2B. Referring to FIG. 2C, it is clear that the grayscale distribution within the first interval resulted from performing a DCE processing by using the prior art is much different from the original distribution as shown in FIG. 2A, and that is a distortion frame image caused by an excessive enhancement processing.
In addition, the conventional technique is not suitable for processing a frame image with a black background area, either. FIG. 3 is a diagram of a frame with two black background areas. It is known that some frames include not only a normal display area 301, but also full-dark display areas 303 and 305 without any frame displayed. The areas 303 and 305, as shown in FIG. 3, are termed as black background areas.
During calculating out a transformation curve to perform a DCE processing on a frame having a black ground area in the prior art, the number of pixels of the black ground area is together counted as well. However, the black ground area is not an effective display area. Therefore, such a statistical operation containing the number of pixels of the black ground area in the prior art is erroneous, which would cause a serious distortion with the DCE processing.